// 菜单请求参数
import MetaProps = Menu.MetaProps;
import {UserInfoModel} from "@/models/authModel.ts";

export interface RequestMenuModel {
    id?: number;
    parent_id: number,
    name: string,
    path: string,
    redirect?: string,
    component?: string,
    title: string,
    icon?: string,
    active?: string,
    tag?: string,
    type: string,
    is_hide?: string,
    is_full?: string,
    is_affix?: string,
    is_keep_alive?: string,
    sort: number,
    state: string,
    permission?: RouteModel[];
    role?: string[];
    meta?: MetaProps;
}

export interface RouteModel {
    route: string;
    method: string;
    description: string;
}

export interface RequestRoleModel {
    id?: number;
    name: string;
    tag: string;
    description?: string;
    state: string;
    menus?: number[];
}

/**
 * 角色模型
 */
export interface RoleModel {
    id: number;
    name: string;
    tag: string;
    description: string;
    state: string;
    menus?: number[];
    created_at: string;
    updated_at: string;
}

/**
 * API模型
 */
export interface ApiModel {
    id: number;
    method: string;
    name: string;
    path: string;
    description: string;
}

/**
 * 用户列表的用户模型
 */
export interface UserModel {
    id: number;
    nickname: string;
    avatar?: string | Blob;
    email: string;
    password?: string;
    realname?: string;
    mobile?: string;
    identity?: string;
    gender: string;
    description?: string;
    created_at?: string;
    roles?: number[];
}

export interface LoginLogModel {
    id: number;
    user_id: number;
    ip: string;
    user_agent: string;
    state: string;
    description?: string;
    created_at: string;
    user?: UserInfoModel;
}

export interface LoggerModel {
    id: number;
    user_id: number;
    type: string;
    model: string;
    before: object;
    after: object;
    ip: string;
    created_at: string;
    user?: UserInfoModel;
}

/**
 * 字典分类列表模型
 */
export interface DictCateModel {
    id: number;
    name: string;
    code: string;
}

/**
 * 字典详情列表模型
 */
export interface DictInfoModel {
    id: number;
    name: string;
    key: string;
}